<?php
/**
 * @package WordPress
 * @subpackage St_Marys
 */

get_header(); ?>

	<div id="content">

		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

			<form action="#"><fieldset><legend><?php the_title(); ?></legend></fieldset></form>

			<div class="post" id="post-<?php the_ID(); ?>">
				<div class="entry">

					<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

					<?php if($subpages = get_posts(array(
						"orderby" => "title",
						"order" => "ASC",
						"post_parent" => $post->ID,
						"post_type" => "page"))): ?>

						<?php foreach($subpages as $page): ?>
							<div class="page_links" id="page-<?php echo($page->ID) ?>">
								<a href="<?php echo(get_permalink($page->ID)) ?>"><?php echo($page->post_title) ?> &raquo;</a>
							</div>
						<?php endforeach; ?>

					<?php endif; ?>

					<p class="meta">This page was last updated on
						<?php the_modified_date(); ?> at <?php the_modified_time() ?></p>
					<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>

				</div>
			</div>

		<?php endwhile; endif; ?>

	</div>

<?php get_footer(); ?>